UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0bhLMAo5i73nXzVi/83YF0m7P37TfJyPwYST920Z9v4='
WHERE
key_id = 'd44e40553d2e6be7b5da449fff7ba10b4c0b7eab2b62f99d68067b938afb12c5'
AND (
token = '0bhLMAo5i73nXzVi/83YF0m7P37TfJyPwYST920Z9v4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)