UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UmA7ekwDiFs+mNOH287TfQkCJUeUPxgS5YroVU4GvY0='
WHERE
key_id = 'b9ce9af0488e109b304c862a1ad2c9f5e5192cf8fc76a71e97b8bab2d3646272'
AND (
token = 'UmA7ekwDiFs+mNOH287TfQkCJUeUPxgS5YroVU4GvY0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)