UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pBnJXP8gnP/58eiw08KeJ6E8YNUwwS+kbEVlsyr5JOs='
WHERE
key_id = '28a1e1dd453221e72080b8284efa24d66c7eb8ddccfbe4c4c8c6aef396d4419f'
AND (
token = 'pBnJXP8gnP/58eiw08KeJ6E8YNUwwS+kbEVlsyr5JOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)