UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IU+nYE/UXfTjMyrMyFZMXmuz4WdKG/7oVj4FA8fo0kE='
WHERE
key_id = '589dc7e88969e08e1a2110aa40090b36c46587a3e0de1bb717b0bf5751b290d1'
AND (
token = 'IU+nYE/UXfTjMyrMyFZMXmuz4WdKG/7oVj4FA8fo0kE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)