UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hZrQD/puI1trhua5AhMDG2+5xRN+iFzqOy6fZfQ7nnM=' 
WHERE 
  key_id = 'd5304b0bf41c7edf365534022cf6fe7d2f0faabddb549d8293502727c7bf6af4' 
  AND (
    token = 'hZrQD/puI1trhua5AhMDG2+5xRN+iFzqOy6fZfQ7nnM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033