UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kJkB1+AxJ1XrBT0Btk3oyS9hs3TYET4OIWcnFAVV9Ss='
WHERE
key_id = '2171f08ab23a42b2993010fb467e6d5d3f17eb3a5ad8de14cdd480e26c565f76'
AND (
token = 'kJkB1+AxJ1XrBT0Btk3oyS9hs3TYET4OIWcnFAVV9Ss='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)