UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jgf26HYS6BPUsQ3nae/jsdfB4myRlMYAsL3WBF0zeAI='
WHERE
key_id = '155d974ec172174f439e25d5a534b0434539e06f5a3cef0c3247d99986810cf2'
AND (
token = 'jgf26HYS6BPUsQ3nae/jsdfB4myRlMYAsL3WBF0zeAI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)