UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y4uXvg+A/1snlbiklkR35BNQPmpsNsLLuQK7Uemm3/8=' 
WHERE 
  key_id = '72660d1c6305f0f3e71222958a0a25cdb0c8de0f65f7c0624c2247985df1a33f' 
  AND (
    token = 'Y4uXvg+A/1snlbiklkR35BNQPmpsNsLLuQK7Uemm3/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040