UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U6rQyHym0jbaCVIzl1O2RpdZ7ONvC9i1aAz0CJj3N6g='
WHERE
key_id = '271558769b1c9c1fa049b67b75585a42784a90dbc631fa316743654f77c54fea'
AND (
token = 'U6rQyHym0jbaCVIzl1O2RpdZ7ONvC9i1aAz0CJj3N6g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)