UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LBuxxZDsDlJZYDoIohkgjgsYGrEAZok2XQ5HAKeAVcs='
WHERE
key_id = '5a671fbb08aff9b526d8229b1917ea58ce97b0674fed1fb716a90f804503831e'
AND (
token = 'LBuxxZDsDlJZYDoIohkgjgsYGrEAZok2XQ5HAKeAVcs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)