UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mFHLciwoADHa/SkdpkkhNllevx155Nd2TeSQeAXepZo='
WHERE
key_id = 'b4246e1ada9c40ff5017db591e0a6fa7acab60883a7afa5b25e50d91ad6ac6dc'
AND (
token = 'mFHLciwoADHa/SkdpkkhNllevx155Nd2TeSQeAXepZo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)