UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GeAyhtYTg5iewR7dYf/XoH6YKsOA17LU1OMBeFTQNPc='
WHERE
key_id = 'd8cce67b50f5210f2dea3e3a62cd01cfeacf94de3d5f74c7564612721df3743e'
AND (
token = 'GeAyhtYTg5iewR7dYf/XoH6YKsOA17LU1OMBeFTQNPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)