UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oZ4EZK7JJvi6gagRovc+ke7M5fYEipRLiWw5v0L+g/4=' 
WHERE 
  key_id = 'd42333bbef744225777e05df157de998e6cf37da6911acbd1d923c7eb82acae8' 
  AND (
    token = 'oZ4EZK7JJvi6gagRovc+ke7M5fYEipRLiWw5v0L+g/4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021