UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '19EMQrgSAV7KJtCTNF6AmaNbJZTPzFJ7LrtYYGe0Tho='
WHERE
key_id = '17bb57dffdf74825566a0ee3d99dc9a589782e11585bbb1d29f6744787047c91'
AND (
token = '19EMQrgSAV7KJtCTNF6AmaNbJZTPzFJ7LrtYYGe0Tho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)