UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm7p/FqC1ishvK0Hnf556OGECJEs8ZN/m3H14VjyKgMM='
WHERE
key_id = '301f3db44d69fef306b2ca2a5bd6613cc1af2d8e8a34d6561a729074df125997'
AND (
token = 'm7p/FqC1ishvK0Hnf556OGECJEs8ZN/m3H14VjyKgMM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)