UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cCFbDKyWMFJux45XWsdV6y6/VjkA0BOcvZnZ1TdVtyo=' 
WHERE 
  key_id = 'dc85358b611f63ef55e4b2707246c16d6a278667be1f18a02863d34498aabd93' 
  AND (
    token = 'cCFbDKyWMFJux45XWsdV6y6/VjkA0BOcvZnZ1TdVtyo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034