UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uKa9qvVbwtHGn+MpRrN+cnd70ZByQU0R8ddOxrWxqeY='
WHERE
key_id = '1c92cead8934abe34669c2324f1aaf7e244b12204cf4e73160e96159e5051431'
AND (
token = 'uKa9qvVbwtHGn+MpRrN+cnd70ZByQU0R8ddOxrWxqeY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)