UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qj2L242YoTExWkOlxsn/JFONI9n8iDMk5lThUoovHoc='
WHERE
key_id = '020e18e8928ff4ebae52cd5308d24f64837f6ee2e94d18313cfb6919845a9168'
AND (
token = 'Qj2L242YoTExWkOlxsn/JFONI9n8iDMk5lThUoovHoc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)