UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RlqudcMEJLoluuFlLdWlP+YOwmX9CsBSmt+aqZvG5kA='
WHERE
key_id = '7a3d027e313c7201944126929052c85dd0933c087e876f868bd163cdda1fa09c'
AND (
token = 'RlqudcMEJLoluuFlLdWlP+YOwmX9CsBSmt+aqZvG5kA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)