UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fa/tduZBGQ0J3Aiu7kSjcQvzuP6hbQfmfHiDfZEjzZI='
WHERE
key_id = '17f0092858282c1467775fa7521ac3e9d6f15c2d50fbad58c8191b1e7aa2593c'
AND (
token = 'Fa/tduZBGQ0J3Aiu7kSjcQvzuP6hbQfmfHiDfZEjzZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)