UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8oGbzegpL2ruB+yqDhPgcMPo4CcoCC/GXzDC3a1eX9U='
WHERE
key_id = '4e38f3b379abfd8040345612b16cd3d35455d6cd54a37784637f5259ab84eb99'
AND (
token = '8oGbzegpL2ruB+yqDhPgcMPo4CcoCC/GXzDC3a1eX9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)