UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/ytGsid87KgBijPIwxAXppvUHue1fXe5598eoJiBams=' 
WHERE 
  key_id = '58f9b7d8e6cc3d155af7187ece89b651b2a6d9b8ee781f81dfeeac584c010350' 
  AND (
    token = '/ytGsid87KgBijPIwxAXppvUHue1fXe5598eoJiBams=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033