UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qSjH/b7qjPbDx7SIr+6ZKk/mHAvsn5FZAI6beHZNN9c='
WHERE
key_id = 'd9ef1255facdc3ee085eb69fe4702e666149c690ccd19b14f89815033c1ca582'
AND (
token = 'qSjH/b7qjPbDx7SIr+6ZKk/mHAvsn5FZAI6beHZNN9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)