UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7fLJ/0sw4L6zCdZvFQEOYbiEf9b6AkmAph1ISDq0Xds=' 
WHERE 
  key_id = '83901e6df3a5f141cd7bf00abbbc41fb0f01a6285d540ff089b6e6dc328ffccf' 
  AND (
    token = '7fLJ/0sw4L6zCdZvFQEOYbiEf9b6AkmAph1ISDq0Xds=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025