UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4M59FqVGi7DBkRUlT0rLw9mLWp6hY3lEo4TQJ+U1sYg='
WHERE
key_id = 'e6280003a836148c2f209fdd24644856cf2c2053fdc86c7aa8eb8f8bfad866e1'
AND (
token = '4M59FqVGi7DBkRUlT0rLw9mLWp6hY3lEo4TQJ+U1sYg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)