UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rptuP+j9iGirbR0pDyotrZ3vGhHHCu1KWdv5mogKjNM=' 
WHERE 
  key_id = '0ecad7cf4bd539953b7875465fedfb89d15a7bce71cd54242d8c4ca19b82f93a' 
  AND (
    token = 'rptuP+j9iGirbR0pDyotrZ3vGhHHCu1KWdv5mogKjNM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037