UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K7OLHNV6gBaQ5DIQod51OW+8Zll32/SdSVSKmrMVJdc=' 
WHERE 
  key_id = '63b699ccda25f5712927abddbef993362f14e2ab8171ac975b516426d3d525e7' 
  AND (
    token = 'K7OLHNV6gBaQ5DIQod51OW+8Zll32/SdSVSKmrMVJdc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020