UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9c5JX9JhifebvjbpXSf91Pt2XgDnKM3sMAonNB8bLqk=' 
WHERE 
  key_id = '2b2628c5bb6e888ecdc044540ad447e54dcee386c27316e8e81f7602f8240555' 
  AND (
    token = '9c5JX9JhifebvjbpXSf91Pt2XgDnKM3sMAonNB8bLqk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00209