UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M66umDlMBVB1pt1JbjrGEYkH7wN0fiuPdDy1vzm5BFs='
WHERE
key_id = 'cbe751dff3963f50a59bc08107bea83c38b4e5b9c7c2cc687e3ce66b50446d2d'
AND (
token = 'M66umDlMBVB1pt1JbjrGEYkH7wN0fiuPdDy1vzm5BFs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)