UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HPxSIFOZMgpJPb8tAh8upVz372Ay4uJ4owsUui6xjiU='
WHERE
key_id = '8e1974a408d3ce025ea1def8eb56f5d57479e21dbe20becbf6bd91369dc340a9'
AND (
token = 'HPxSIFOZMgpJPb8tAh8upVz372Ay4uJ4owsUui6xjiU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)