UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HgGeL1NZsA02KaQnbBJsbrSVo5d8ZA5Lkw1NYdFdGMk=' 
WHERE 
  key_id = '5fc3cc8f63edbb1c905241760442f38c5e1efe845c7a79b1fd9daa7f79b685bb' 
  AND (
    token = 'HgGeL1NZsA02KaQnbBJsbrSVo5d8ZA5Lkw1NYdFdGMk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026