UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i3CWV/qmV4kwx+gDwPtHXOiioMrzPRtoXnplItfBcZg='
WHERE
key_id = '6cefa655856bb7c60e885923eba850170e0fbd699495894da2e9a5905bb122b3'
AND (
token = 'i3CWV/qmV4kwx+gDwPtHXOiioMrzPRtoXnplItfBcZg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)